package com.weather.modules.city.controller;

import com.weather.common.vo.City;
import com.weather.modules.city.service.CityClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/quartz")
public class CityController {

    @Autowired
    private CityClient cityClient;

    @RequestMapping(value = "/cities",method = RequestMethod.GET)
    public List<City> listCity() {
        // 通过Feign客户端来查找
        List<City> cityList = cityClient.listCity();
        return cityList;
    }
}
